package com.js.lib_common.mvp.model.response;

import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Locale;

/**
 * Created by wz on 2021/5/20.
 */
public class BindBean implements MultiItemEntity, Serializable {

    public static final int REQUEST_CODE_BIND = 0X01;//绑定,点击扫码用到
    public static final int REQUEST_CODE_BIND_MACHINEID = 0X011;//绑定整机号
    public static final int REQUEST_CODE_BIND_MATERIALID = 0X012;//绑定物料号
    public static final int REQUEST_CODE_BIND_PROCESS = 0X013;//绑定工序


    public static final int REQUEST_CODE_CHECK = 0X02;//检查，点击扫码用到
    public static final int REQUEST_CODE_CHECK_MACHINEID = 0X021;//检查,整机号
    public static final int REQUEST_CODE_CHECK_MATERIALID = 0X022;//检查,物料号


    public static final int REQUEST_CODE_CHECK_IN = 0X03;//入库
    public static final int REQUEST_CODE_CHECK_OUT= 0X04;//出库
    public static final int REQUEST_CODE_DEFAULT_WORK= 0X05;//设置默认工序
    public static final int REQUEST_CODE_CHECK_OUT_CUSTOM= 0X06;//客户定制
    private  int type;//类型，整机，工序，物料
    private  String qrcode;//二维码
    private  boolean isStandard=true;//入库检测情况,是否合格
    private  String  clientCode;//出库时，客户提供的绑定编码
    private  String info;//备注


    private String time =  new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.CHINA).format(new java.util.Date());//扫码时间

    private MachineIdInfoResponse mMachineIdInfo;//整机码信息
    private  MaterialIdInfoResponse  mMaterialIdInfo;//物料码信息
//    private ProcessInfoInfoResponse mProcessInfoInfo;//工序码信息
    public BindBean(){}
    public BindBean(int type, String time, String qrcode) {
        this.type = type;
        this.time = time;
        this.qrcode = qrcode;
    }

    public BindBean(String qrcode) {
        this.qrcode = qrcode;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getQrcode() {
        return qrcode;
    }

    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public int getItemType() {
        return type;
    }

    public boolean isStandard() {
        return isStandard;
    }

    public void setStandard(boolean standard) {
        isStandard = standard;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getClientCode() {
        return clientCode;
    }

    public void setClientCode(String clientCode) {
        this.clientCode = clientCode;
    }

    @Override
    public String toString() {
        return "BindBean{" +
                "type=" + type +
                ", time='" + time + '\'' +
                ", qrcode='" + qrcode + '\'' +
                ", isStandard=" + isStandard +
                ", info='" + info + '\'' +
                '}';
    }
    //不能直接比较List中的对象，需要重写bean对象的equals和hashCode方法
    public boolean equals(Object obj) {
        BindBean u = (BindBean) obj;

        return qrcode.equals(u.qrcode);
    }

    public int hashCode() {
        String in = qrcode;
        return in.hashCode();
    }

    public MachineIdInfoResponse getMachineIdInfo() {
        return mMachineIdInfo;
    }

    public void setMachineIdInfo(MachineIdInfoResponse machineIdInfo) {
        mMachineIdInfo = machineIdInfo;
    }

    public MaterialIdInfoResponse getMaterialIdInfo() {
        return mMaterialIdInfo;
    }

    public void setMaterialIdInfo(MaterialIdInfoResponse materialIdInfo) {
        mMaterialIdInfo = materialIdInfo;
    }

//    public ProcessInfoInfoResponse getProcessInfoInfo() {
//        return mProcessInfoInfo;
//    }
//
//    public void setProcessInfoInfo(ProcessInfoInfoResponse processInfoInfo) {
//        mProcessInfoInfo = processInfoInfo;
//    }
}
